package ar.uba.fi.posgrado.economy.model;

import java.util.ArrayList;
import java.util.List;

import ar.uba.fi.posgrado.common.model.PosgradoEnum;

/**
 * Condición Impositiva
 * 
 * @author pablo.tortorella
 */
public enum Terms implements PosgradoEnum {
	CONSUMIDOR_FINAL, IVA_RESPONSABLE_INSCRIPTO, IVA_RESPONSABLE_NO_INSCRIPTO, EXENTO, RESPONSABLE_MONOTRIBUTO, NO_RESPONSABLE_IVA;

	public String toStringValue() {
		if (this.equals(Terms.CONSUMIDOR_FINAL)) {
			return "CONSUMIDOR FINAL";
		} else if (this.equals(Terms.IVA_RESPONSABLE_INSCRIPTO)) {
			return "IVA RESPONSABLE INSCRIPTO";
		} else if (this.equals(Terms.IVA_RESPONSABLE_NO_INSCRIPTO)) {
			return "IVA RESPONSABLE NO INSCRIPTO";
		} else if (this.equals(Terms.EXENTO)) {
			return "EXENTO";
		} else if (this.equals(Terms.RESPONSABLE_MONOTRIBUTO)) {
			return "RESPONSABLE MONOTRIBUTO";
		}
		// else if (this.equals(Terms.NO_RESPONSABLE_IVA)) {
		return "NO RESPONSABLE IVA";
		// }
	}

	public static Terms fromStringValue(String value) {
		Terms term;
		if (value.equals("CONSUMIDOR FINAL")) {
			term = Terms.CONSUMIDOR_FINAL;
		} else if (value.equals("IVA RESPONSABLE INSCRIPTO")) {
			term = Terms.IVA_RESPONSABLE_INSCRIPTO;
		} else if (value.equals("IVA RESPONSABLE NO INSCRIPTO")) {
			term = Terms.IVA_RESPONSABLE_NO_INSCRIPTO;
		} else if (value.equals("EXENTO")) {
			term = Terms.EXENTO;
		} else if (value.equals("RESPONSABLE MONOTRIBUTO")) {
			term = Terms.RESPONSABLE_MONOTRIBUTO;
		} else /* if (value.equals("NO RESPONSABLE IVA")) */{
			term = Terms.NO_RESPONSABLE_IVA;
		}
		return term;
	}

	public static List<Terms> findAll() {
		List<Terms> response = new ArrayList<Terms>();
		response.add(CONSUMIDOR_FINAL);
		response.add(IVA_RESPONSABLE_INSCRIPTO);
		response.add(IVA_RESPONSABLE_NO_INSCRIPTO);
		response.add(EXENTO);
		response.add(RESPONSABLE_MONOTRIBUTO);
		response.add(NO_RESPONSABLE_IVA);
		return response;
	}
}
